package sz.factory;

import sz.*;

public class OperationFactory {
    public static Operation createOperation(String operate){
        Operation operation=null;
        switch (operate){
            case "+":
                operation=new Operationjia();
                break;
            case "-":
                operation=new Operationjian();
                break;
            case "*":
                operation=new Operationcheng();
                break;
            case "/":
                operation=new Operationchu();
                break;
            default:
               throw  new IllegalArgumentException("不支持的运算符的");
        }
        return operation;
    }
}
